package com.yan.validator;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

/**
 * Created by yanl_ on 2018/1/7.
 */
public class LoginValidator extends Validator {
    @Override
    protected void validate(Controller controller) {

        validateRequired("userName","namError","name is null");
        validateRequired("password","pwdError","pwd is null");
    }

    @Override
    protected void handleError(Controller controller) {
            controller.keepPara("userName","password");


            controller.render("index.jsp");
    }
}
